<div class="container member-container">
    <?php include $this->getViewFile('../lib/leftmenu'); ?>
    <div class="col-md-10 member-con menber-score-good ">        
        <div style="width: 886px;border: 1px solid #ddd" >
            <div style="width: 886px;background-color: #ffffff;overflow:hidden ">
                <span style="float: left;font-size: 16px;padding-top:20px;font-weight: 500;padding-left: 18px;font-family: '微软雅黑' "><?php echo $username; ?>，你好～</span>
                <span style="float: right;padding-right:12px; height:60px">
                    <a class="complain"  target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=1607188278&site=qq&menu=yes">
                        <img  style="height:60px "src="<?php echo Yii::app()->theme->baseUrl; ?>/assets/images/complain.jpg">
                    </a>
                </span>
            </div>
            <table>
                <tr>
                    <td class="bm_query_biaoqian <?php if ($label == 0) echo "tab_b tab_c"; ?>" ><a class="tab_a" href="<?php echo YzwController::U('goods', array('label' => 0)) ?>">待审核产品<br><?php echo $count[0]; ?></a></td>
                    <td class="bm_query_biaoqian <?php if ($label == 1) echo "tab_b tab_c"; ?>" ><a class="tab_a" href="<?php echo YzwController::U('goods', array('label' => 1)) ?>">审核中产品<br><?php echo $count[1]; ?></a></td>
                    <td class="bm_query_biaoqian <?php if ($label == 2) echo "tab_b tab_c"; ?>" ><a class="tab_a" href="<?php echo YzwController::U('goods', array('label' => 2)) ?>">样品邮寄中<br><font style="color:#DB014D "><?php echo $count[2]; ?></font></a></td>                    
                    <td class="bm_query_biaoqian <?php if ($label == 3) echo "tab_b tab_c"; ?>" ><a class="tab_a" href="<?php echo YzwController::U('goods', array('label' => 3)) ?>">等待排期<br><?php echo $count[3]; ?></a></td>
                    <td class="bm_query_biaoqian <?php if ($label == 4) echo "tab_b tab_c"; ?>" ><a class="tab_a" href="<?php echo YzwController::U('goods', array('label' => 4)) ?>">审核未通过<br><?php echo $count[4]; ?></a></td>
                    <td class="bm_query_biaoqian <?php if ($label == 5) echo "tab_b tab_c"; ?>" ><a class="tab_a" href="<?php echo YzwController::U('goods', array('label' => 5)) ?>">上架<br><?php echo $count[5]; ?></a></td>
                    <td class="bm_query_biaoqian <?php if ($label == 6) echo "tab_b tab_c"; ?>" ><a class="tab_a" href="<?php echo YzwController::U('goods', array('label' => 6)) ?>">下架<br><?php echo $count[6]; ?></a></td>

                </tr>
            </table>
            <table id="tab_col">
                <tbody>
                    <tr>
                        <td width="160">商品</td>
                        <td width="120">活动价</td>
                        <td width="60">报名时间</td>
                        <td width="120">报名分类</td>
                        <td width="120">专场名称</td>
                        <!--<td width="100">状态</td>-->
                        <td width="160">操作</td>	                    
                    </tr>
                    <?php if ($goods): ?>
                        <?php foreach ($goods as $good): ?>
                            <tr>
                                <td style="padding: 8px 8px"><a href="<?php echo $good->detail_url ?>" target="_blank"><img src="<?php echo $good->product_img ?>" width="80" height="80" /></a></td>
                                <td><?php echo $good->promo_price ?></td>
                                <td><?php echo date("Y-m-d H:i:s", $good->add_time); ?></td>
                                <td><?php echo $cats[$good->cat_id]['cat_name']; ?></td>
                                <td><?php echo GoodsBmModel::getSpecialHtmlDetail($good->special_id); ?></td>
                                <!--<td><?php echo $good->getHtmlStatus($good); ?></td>-->
                                <td id="operation_<?php echo $good->goods_id ?>" margin-left: auto margin-right: auto><?php echo $good->getMemberBmMayAction($good); ?></td>
                            </tr>
                        <?php endforeach ?>   
                    <?php endif ?>   
                    <?php if ($pages && $pages->pageCount > 1): ?>
                        <tr>
                            <td colspan="5" class="pager">
                                <?php
                                $this->widget('CLinkPager', array(
                                    'header' => "",
                                    'firstPageLabel' => '首页',
                                    'lastPageLabel' => '末页',
                                    'prevPageLabel' => '上一页',
                                    'nextPageLabel' => '下一页',
                                    'pages' => $pages,
                                    'footer' => "<span>共<em>{$pages->pageCount}</em>页</span>",
                                    'maxButtonCount' => 5
                                        )
                                );
                                ?>
                            </td>
                        </tr>
                    <?php endif ?>
                </tbody>       
            </table>
        </div>


    </div>
    <div class="clearfix"></div>

    <div id="froms" style="display:none">
            <table >
                <tbody>
                    <tr>
                      <th width="100">快递公司</th>
                      <td><input type="text" name="company" value="" class="" id="company" placeholder="快递公司"></td>
                    </tr>
                    <tr>
                      <th width="100">快递单号</th>
                      <td><input type="text" name="numbers" value="" class="" id="numbers" placeholder="快递单号"></td>
                    </tr>

                </tbody> 
            </table>       
    </div>

</div>
<script src="<?php echo Yii::app()->params->staticUrl; ?>statics/js/ajaxForm.js"></script> 
<link rel="stylesheet" href="<?php echo Yii::app()->params->staticUrl; ?>statics/js/artDialog6/css/ui-dialog.css">
<script src="<?php echo Yii::app()->params->staticUrl; ?>statics/js/artDialog6/js/dialog-min.js"></script> 

<script type="text/javascript">
    $(function(){
        $(document).on('click', '.bm_query_g', function(){
            var obj = $(this);
            var url = obj.attr('href');
            var goods_id = obj.data('goods_id');

            var dialogs = dialog({
                title:'请填写相关信息',
                okValue:'确定',
                ok:function(){
                    var company = $(".ui-dialog-content [name='company']").val();
                    var numbers = $(".ui-dialog-content [name='numbers']").val();
                    var dia =   dialog({
                                    title: '提示',
                                    cancel: false,
                                    okValue: '确定',
                                    ok: function() {
                                    }
                                });

                    if(!company){
                        dia.content('快递公司名称不能为空');
                        dia.show();
                        return false;
                    }
                    if(!numbers){
                        dia.content('订单号不能为空');
                        dia.show();
                        return false;
                    }

                    $.post(url, {company:company, numbers:numbers}, function(data){
                        if(data.status){
                            $("#operation_" + goods_id).html(data.html_operation);
                        }
                        dia.content(data.info);
                        dia.show();
                        return false;                                                
                    }, 'json');
                    return true;
                },
                cancelValue:'取消',
                cancel:function(){
                    return true;
                },
                content:$("#froms").html(),

            });
            $(".ui-dialog-content [name='company']").val($("#company_" + goods_id).val());
            $(".ui-dialog-content [name='numbers']").val($("#numbers_" + goods_id).val());
            

            dialogs.show();
            return false;

        })
    })
</script>
